OpacityΒΆ

Using opacity

The opacity is returned by the shader using the Oi Output. The predefined shaders (Surface and Curves) have different attributes to control the opacity.

The Surface shader provides a simple Mask attribute. See the Library/Materials/Surface shader.

The Curves shader can control the opacity of the curve, the opacity in shadows and the curve tip opacity. See the Library/Materials/Curves shader.

Optimizations

The objects in Guerilla Render can be semi-transparent. Guerilla Render can render them exactly but the render time may become heavy in some pathological situations like transparent furs or tree leaves using opacity textures.

Guerilla Render provides different opacity modes to improve the render time depending on the situation. The result is similar with the exact mode but the render time is much lower, close to the render time of an opaque rendering.

This opacity mode is controlled by the "Shading -> Opacity Mode" attribute.

This scene includes 2500+ tree instances. The leaves are mapped with an opacity texture. The render time is 3 times lower using the ST opacity mode than the Extact one.

Opacity Mode : Exact

The opacity is exact in all rays. This mode is the slowest one. The maximum opacity depth is controlled by the "Render Settings -> Performances -> Max opacity Depth" attribute.

Use cases :

  • sprites with an opacity texture and an opacity varying with the particle age or the particle id.
  • any complex opacity setup.

Opacity Mode : Opaque Shadows

Opacity Mode : Opaque Shadows

This is the default mode : the opacity is exact but the shadow rays are opaque. The maximum opacity depth is controlled by the "Render Settings -> Performances -> Max opacity Depth" attribute.

Use cases :

  • opaque objects.
  • transparent objects for which opaque shadows are OK.

Opacity Mode : Constant

This mode assumes the opacity is constant on the object. This mode is fast to render and uses almost no memory. There is no opacity depth limit.

Use cases :

  • a simple thin glass with a constant opacity.
  • fur with a constant opacity.

Opacity Mode : Vertex

This mode assumes the opacity is constant on every object vertices. This mode is fast to render. The opactiy is stored at every object vertices in memory. There is no opacity depth limit.

Use cases :

  • transparent fur/hair where the strands opacity are different.
  • transparent surfaces with a low frequency transparency.
  • particles with an opacity varying with the particle age or the particle id.

Opacity Mode : UV

For curve meshes only. This mode assumes the opacity is varying on the curves u and v parameter. This mode is fast to render and uses almost no memory. The number of steps used to subdivide the u and v parameter is given by the Opacity Bake Resolution attribute. There is no opacity depth limit.

Use case :

  • transparent fur/hair where the opacity along the strand is the same for every strand.
  • transparent fur/hair where the opacity is mapped using the curves implicit uv coordinates.

Opacity Mode : ST

For triangle meshes only. This mode assumes the opacity is varying on the surface st parameters and the st parameters to be between [0,1]. This mode is fast to render. The number of steps used to subdivide the st parameters is given by the Opacity Bake Resolution attribute. There is no opacity depth limit.

Use case :

  • surfaces with a simple opacity texture, like tree leaves.
  • sprites with an opacity texture (not using the particle age or the particle id).